Add CSV to BabelTests tool#77
Draft
gaurav wants to merge 2 commits into
Draft
Conversation
…AML. Translator collaborators sometimes circulate spreadsheets pairing a CURIE column with a label, equivalent CURIE, or Biolink type. This adds a click CLI that ingests such CSVs and emits a paste-ready YAML babel_tests block for a GitHub issue, optionally validating each row against a NodeNorm target from tests/targets.ini and reporting failures on stderr. The tool reuses ASSERTION_HANDLERS and CachedNodeNorm directly so the emitted YAML is guaranteed to match what GitHubIssuesTestCases parses, and per-assertion semantics never drift between the two code paths. Wires hatchling as the build backend (packaging src/ as-is so existing `from src.babel_validation.X` imports keep working) so the csv-to-babeltests console script can be exposed via [project.scripts]. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced May 4, 2026
…v-to-babeltests. - --from-google-sheet URL: download any Google Sheet CSV-export URL and run the same downstream pipeline as a local file - --from-yaml FILE (reverse mode): parse an existing babel_tests: YAML block and validate it against --target, printing a report to stderr - INPUT_CSV, --from-google-sheet, and --from-yaml are mutually exclusive - Add tests/data/csv_to_babeltests_fixture.csv as a committed data asset with tricky label cases (commas, apostrophes, brackets), an empty CURIE row, and a duplicate; extend it to cover new edge cases as they arise - 11 new unit tests covering the fixture CSV pipeline and parse_yaml_blocks; all 24 tests pass - Unblock tests/data/ from .gitignore so fixture files can be committed Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Translator collaborators sometimes circulate spreadsheets pairing a CURIE column with a label, equivalent CURIE, or Biolink type. This adds a click CLI that ingests such CSVs and emits a paste-ready YAML babel_tests block for a GitHub issue, optionally validating each row against a NodeNorm target from tests/targets.ini and reporting failures on stderr.
The tool reuses ASSERTION_HANDLERS and CachedNodeNorm directly so the emitted YAML is guaranteed to match what GitHubIssuesTestCases parses, and per-assertion semantics never drift between the two code paths.
Wires hatchling as the build backend (packaging src/ as-is so existing
from src.babel_validation.Ximports keep working) so the csv-to-babeltests console script can be exposed via [project.scripts].WIP. Should be merged after PR #67